import service from './userIndex';
import { Encrypt } from 'U/encryption';
// -----------------------------------------------------------------------------//
// 用户登录
export function login({ name, password }) {
    let pas = Encrypt(password);
    return service('post', `/loginController/login`, { name, password: pas });
}
// 用户退出
export function logout() {
    return service('post', `/loginController/logout`);
}
// 用户注册
export function register(param) {
    param.password = Encrypt(param.password);
    return service('post', `/loginController/register`, param);
}
// 检查名字是否重复
export function checkName(name) {
    return service('get', `/loginController/verifyUserName?name=${name}`);
}
// 检查邮箱是否重复
export function checkEmail(email) {
    return service('get', `/loginController/verifyUserEmail?email=${email}`);
}

// 检查邮箱，激活用户
export function checkEmailToken(token) {
    return service('get', `/loginController/checkEmailToken?token=${token}`);
}

// 获取用户行业
export function getUserIndustry() {
    return service('get', '/public/userIndustry');
}
export function getUserType() {
    return service('get', '/public/userType');
}
